
var currentPageNum = 1;
//分页插件
var jqp = null;
//初始化分页
$(function () {
    jqp = $.jqPaginator('#pagination', {
	    visiblePages: 10,
	    currentPage: pageNumber,
	    pageSize: pageSize,
	    totalCounts: totalCount,
	    onPageChange: function (num, type) {
	    	currentPageNum = num;
	        if(num != pageNumber){
	        	//window.location.href = getPath() + "base/findBaseRole/" + num +"/"+pageSize + (isFilter ? ("?" + $("#searchForm").serialize()) : "");
	        	window.location.href = getPath() + "base/role/list/" + num +"/"+pageSize +"?"+ $("#searchForm").serialize();
	        }
	    }
    });
    
    setGridListCheckBox("roleTable");
    setSearchBtnClick("base/role/list/1/"+pageSize+"?");//搜索
    setAddBtnClick("base/role/add",{dialogId:'addDialog'});
	gridDataDelete('base/role/delete/',{
		multiple:true,
		tableId:'roleTable',
		successUrl:"base/role/list/"+currentPageNum+"/24"
	});//多选删除 
	
	$("#refreshCacheBtn").click(function(){
		createWindow('确定要刷新缓存？',{
            cancleEnable:true,
            callBack:function(){
            	$("#loadDiv").loading().showLoading();
            	post(getPath()+"base/role/refreshRoleCache",{},function(result){
        			if(result=="isSuccess"){
        				$("#loadDiv").loading().hideLoading();
        				createWindow("缓存刷新成功",{url:getPath()+"base/role/list/1/"+pageSize}).dialog("open");
        			}
        		});
            }
        }).dialog('open');
	});
    
//	selectAll("roleTable");//点击全选,判断是全选还是取消全选
//    changTrCss("roleTable");//复选框选择改变，设置此行的样式，并判断当前情况是否为全选的情况
//	changeTrCheckboxStatu("roleTable");//点击一行，改变这行的复选框勾选
//    searchBtnClick("base/role/list/1/"+pageSize+"?");//点击查询
//    addBtnClick("base/role/add");//打开添加窗口
//    editBtnClick("roleTable","base/role/edit/");
//    deleteData("roleTable","base/role/delete/","base/role/list/"+currentPageNum+"/24", 140);//删除数据
    
    //先用，后面删掉
    var mainFrameH = parent.$("#mainFrame").height();
    var searchH = $(".table_search_div").height();
    var addH = $(".table_title_div").height();
    $(".table_list_div").css({"height":mainFrameH-searchH-addH});
    //去除所有控件的虚线框
    removeBlur();
});

